home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / EDITORS / FUE / emacs_rc2 < prev    next >
Text File  |  1991-06-02  |  9KB  |  418 lines

  1. set $discmd FALSE
  2.  
  3. write-message "[Setting up....]"
  4.  
  5. ; If you screen "SNOWS", comment this line
  6.        set $flicker "FALSE"
  7.  
  8. ; To use an IBM-PC EGA card, uncomment the following line
  9. ;     set $sres "EGA"
  10.  
  11. ;macro 1 to toggle function key help display
  12.  
  13. add-global-mode magic
  14. add-global-mode exact
  15. add-global-mode asave
  16. add-global-mode "blue"
  17. add-global-mode "YELLOW"
  18. ;set $sres 12
  19.  
  20. execute-file "ue_mac_rc"
  21.  
  22. ;{{{  bind procedures to macros
  23. ;{{{  1=help
  24. 1 store-macro
  25.   execute-procedure help
  26. !endm
  27.  
  28. ;}}}
  29. ;{{{  2=clear-pick
  30. 2 store-macro
  31.   execute-procedure clear-pick
  32. !endm
  33.  
  34. ;}}}
  35. ;{{{  3=pick-line
  36. 3       store-macro
  37.   execute-procedure pick-line
  38. !endm
  39.  
  40. ;}}}
  41. ;{{{  4=move-line
  42. 4       store-macro
  43.   execute-procedure move-line
  44. !endm
  45.  
  46. ;}}}
  47. ;{{{  5=copy-pick
  48. 5       store-macro
  49.   execute-procedure copy-pick
  50. !endm
  51.  
  52. ;}}}
  53. ;{{{  6=put-buffer
  54. 6       store-macro   
  55.   execute-procedure put-buffer
  56. !endm
  57.  
  58. ;}}}
  59. ;{{{  7=copy-to-fold
  60. 7       store-macro
  61.   execute-procedure copy-to-fold
  62. !endm
  63.  
  64. ;}}}
  65. ;{{{  8=copy-line
  66. 8       store-macro
  67.   execute-procedure copy-line
  68. !endm
  69.  
  70. ;}}}
  71. ;{{{  9=delete-line
  72. 9       store-macro
  73.   execute-procedure delete-line
  74. !endm
  75.  
  76. ;}}}
  77. ;{{{  10=pick-region
  78. 10      store-macro
  79.   execute-procedure pick-region
  80. !endm
  81.  
  82. ;}}}
  83.  
  84. ;{{{  ; 13 - unfile fold
  85. ; 13 - unfile fold
  86. 13 store-macro
  87.   !if &seq $ltype LSOFOLD
  88.     execute-procedure t-filed
  89.   !else
  90.     execute-procedure t-unfiled
  91.   !endif
  92. !endm
  93.  
  94. ;}}}
  95. ;{{{  ; 14 - comment fold
  96. ; 14 - comment fold
  97. 14      store-macro
  98.   execute-procedure comment-fold
  99. !endm
  100.  
  101.  
  102. ;}}}
  103. ;{{{  ; 15 - uncomment fold
  104. ; 15 - uncomment fold
  105. 15      store-macro
  106.   execute-procedure uncomment-fold
  107. !endm
  108.  
  109. ;}}}
  110. ;{{{  ; 16 - auto fold
  111. ; 16 - auto fold
  112. 16      store-macro
  113.   execute-procedure auto-fold
  114. !endm
  115.  
  116. ;}}}
  117. ;{{{  ; 17 - execute t-listbuf
  118. ; 17 - execute t-listbuf
  119.  
  120. 17      store-macro
  121.   !if %t-lstflg
  122.     execute-procedure t-listbufoff
  123.   !else
  124.     execute-procedure t-listbuf
  125.   !endif
  126. !endm
  127.  
  128. ;}}}
  129.   
  130. ;{{{  ; 21 - create-fold macro
  131. ; 21 - create-fold macro
  132. 21      store-macro
  133.     execute-procedure create-fold
  134. !endm
  135.  
  136. ;}}}
  137. ;{{{  ; 22 - enter fold/file
  138. ;22 - enter fold/file
  139. 22 store-macro
  140.   !if &seq $ltype LSOFOLD 
  141.     !force enter-fold
  142.   !else
  143.     execute-procedure t-enter-filed
  144.   !endif
  145. !endm
  146.  
  147. ;}}}
  148. ;{{{  ; 23 - exit fold/file
  149. ; 23 - exit fold/file
  150. 23 store-macro
  151.   !force exit-fold
  152.   !if ¬ $status
  153.     execute-procedure t-exit-filed
  154.   !endif
  155. !endm
  156.  
  157. ;}}}
  158. ;{{{  ; 24 - exit file
  159. ; 24 - exit fold/file
  160. 24 store-macro
  161.   execute-procedure t-exit-filed
  162. !endm
  163. ;}}}
  164.  
  165. ;{{{  ; 25 - execute t-sa
  166. ; 25 - execute t-sa
  167. 25      store-macro
  168.   execute-procedure t-sa
  169. !endm
  170. ;}}}
  171. ;{{{  ; 26 - execute t-listbuf
  172. ; 26 - execute t-listbuf
  173. 26      store-macro
  174.   execute-procedure t-listbuf
  175. !endm
  176. ;}}}
  177. ;{{{  ; 27 - execute t-gotobuf
  178. ; 27 - execute t-gotobuf
  179. 27      store-macro
  180.   execute-procedure t-gotobuf
  181. !endm
  182. ;}}}
  183. ;{{{  ; 28 - execute t-ctags
  184. ; 28 - execute t-ctags
  185. 28      store-macro
  186.   execute-procedure t-ctags
  187. !endm
  188. ;}}}
  189. ;{{{  ; 29 - execute t-cleartags
  190. ; 29 - execute t-cleartags
  191. 29      store-macro
  192.   execute-procedure t-cleartags
  193. !endm
  194. ;}}}
  195. ;{{{  ; 30 - execute t-delbuf
  196. ; 30 - execute t-delbuf
  197. 30      store-macro
  198.   execute-procedure t-delbuf
  199. !endm
  200. ;}}}
  201.  
  202.  
  203. ;{{{  ; 31 - toggle num pad action
  204. 31      store-macro
  205.   set $discmd FALSE
  206.   !if &seq %escnum "num"
  207.     ;{{{  execute macros
  208.     bind-to-key execute-macro-21        M-1
  209.     bind-to-key execute-macro-13        M-2
  210.     bind-to-key execute-macro-3         M-3
  211.     bind-to-key execute-macro-5         M-4
  212.     bind-to-key execute-macro-6         M-5
  213.     bind-to-key execute-macro-2         M-6
  214.     bind-to-key execute-macro-7         M-7
  215.     bind-to-key execute-macro-17        M-8
  216.     bind-to-key execute-macro-32        M-9
  217.     ;}}}
  218.     set %escnum "fold"
  219.     write-message "[Folding keys set M-1 -> M-9: (toggle M-0)]"
  220.   !else
  221.     ;{{{  unbind keys
  222.     unbind-key  M-1
  223.     unbind-key  M-2
  224.     unbind-key  M-3
  225.     unbind-key  M-4
  226.     unbind-key  M-5
  227.     unbind-key  M-6
  228.     unbind-key  M-7
  229.     unbind-key  M-8
  230.     unbind-key  M-9
  231.     ;}}}
  232.     set %escnum "num"
  233.     write-message "[Numeric keys set: (toggle M-0)]"
  234.   !endif
  235.   set $discmd TRUE
  236. !endm
  237. ;}}}
  238.  
  239. ;{{{  ; 32 - display current line
  240. ; display the current line number in message window
  241. 32    store-macro
  242.   write-message $curline
  243. !endm
  244. ;}}}
  245. ;}}}
  246.  
  247. write-message "[Binding function keys]"
  248.  
  249. ;{{{  ;       ***** Rebind the Function key group
  250. ;       ***** Rebind the Function key group
  251. bind-to-key execute-macro-1             FN1
  252. bind-to-key execute-macro-4             FN3
  253. bind-to-key execute-macro-8             FN4
  254. ;}}}
  255.  
  256. ;{{{  ; arc cursor keys
  257. ; arc cursor keys!
  258. bind-to-key previous-line               FNF
  259. bind-to-key next-line                   FNE
  260. bind-to-key forward-character           FND
  261. bind-to-key backward-character          FNC
  262. bind-to-key previous-page               S-FNF
  263. bind-to-key next-page                   S-FNE
  264. bind-to-key next-word                   S-FND
  265. bind-to-key previous-word               S-FNC
  266. bind-to-key beginning-of-file           FN^F
  267. bind-to-key end-of-file                 FN^E
  268. bind-to-key beginning-of-line           FN^C
  269. bind-to-key end-of-line                 FN^D
  270. bind-to-key delete-next-character       S-FN^E
  271. ;}}}
  272.  
  273.  
  274. write-message "[folding keys]"
  275.  
  276. !if &seq $progname "uEmacs" 
  277.   ;{{{  fold key bindings
  278.   bind-to-key execute-macro-22               FNN
  279.   bind-to-key execute-macro-23               FNP
  280.   bind-to-key open-fold                      FNH
  281.   bind-to-key close-fold                     FNJ
  282.   bind-to-key execute-macro-21               FNG
  283.   
  284.   bind-to-key remove-fold                    FN^P
  285.   bind-to-key quick-exit                     FN^H
  286.   
  287.   ; FNB is copy key - copy top line of fold to comment line
  288.   macro-to-key copy-to-fold                   FNB
  289.   
  290.   macro-to-key auto-fold                     ^A
  291.   
  292.   bind-to-key searchfold-forward                ^S
  293.   bind-to-key searchfold-reverse                ^R
  294.   ;}}}
  295.   ;{{{  set fold marks
  296.   write-message "[fold marks.................................]"
  297.   
  298.   ; set fold marks
  299.   
  300.   ; file extensions
  301.   
  302.   set-fold-marks "c"   "/*{{{  "   "/*}}}*/"   "*/"
  303.   set-fold-marks "h"   "/*{{{  "   "/*}}}*/"   "*/"
  304.   
  305.   set-fold-marks "occ" "--{{{  "   "--}}}"     ""
  306.   set-fold-marks "inc" "--{{{  "   "--}}}"     ""
  307.   set-fold-marks "pgm" "--{{{  "   "--}}}"     ""
  308.   set-fold-marks "cfs" "/*{{{  "   "/*}}}*/"   "*/"
  309.   
  310.   set-fold-marks "mak" "#{{{  "    "#}}}"      ""
  311.   set-fold-marks "tt"  "/*{{{  "   "/*}}}*/"   "*/"
  312.   
  313.   set-fold-marks "rc"  ";{{{  "    ";}}}"      ""
  314.   
  315.   ; arc file types...
  316.   
  317.   set-fold-marks "Text"     "{{{  "    "}}}"      ""
  318.   set-fold-marks "Obey"     "| {{{  "  "| }}}"    ""
  319.   set-fold-marks "Command"  "| {{{  "  "| }}}"    ""
  320.   
  321.   ;}}}
  322. !else
  323.   ;{{{  normal bindings
  324.   bind-to-key     beginning-of-line       FN<
  325.   bind-to-key     end-of-line             FN>
  326.   ;}}}
  327. !endif
  328.  
  329. ;{{{  set readhook
  330. 20        store-macro
  331. ; arc version - looks AFTER _ or BEFORE .
  332.  
  333.         set %rctmp &sin $cfname "."
  334.  
  335.         !if &eq %rctmp 0
  336.           ;{{{  look for _
  337.           set %rctmp &sin $cfname "_"
  338.           
  339.           !if &eq %rctemp 0
  340.             !return
  341.           !else
  342.             set %rctmp &mid $cfname &add %rctmp 1 5
  343.           !endif
  344.           ;}}}
  345.         !else
  346.           ;{{{  get text before .
  347.           set %rctmp &left $cfname &sub %rctmp 1
  348.           ;}}}
  349.         !endif
  350.  
  351.         write-message %rctmp
  352.         ;{{{  c or h ?
  353.         !if &or &seq %rctmp "c" &seq %rctmp "h"
  354.                 2 handle-tab
  355.                 add-mode cmode
  356.         !endif
  357.         ;}}}
  358.  
  359.         ;{{{  mss ?
  360.         !if &seq %rctmp "mss"
  361.                 add-mode "wrap"
  362.         !endif
  363.         ;}}}
  364.  
  365.         ;{{{  occ or inc ?
  366.         !if &or &seq %rctmp "occ" &seq %rctmp "inc"
  367.                 add-mode "cmode"
  368.                 2 handle-tab
  369.         !endif
  370.         ;}}}
  371.  
  372.         !force add-mode magic
  373.  
  374. ;        !if %t-lstflg
  375. ;          !force execute-procedure t-listbuf
  376. ;        !endif
  377.  
  378. !endm
  379. set $readhook execute-macro-20
  380. ;}}}
  381.   
  382. ;bind-to-key     next-buffer       M-FNN
  383.  
  384. ;{{{  set up help buffer
  385. ; function key help window display
  386. split-current-window
  387. 1 select-buffer "Function Keys"
  388. insert-string "F1=help F2=comment F3=un/c F4=move   | ENTER |  UP | EXIT |~n"
  389. insert-string "M-1=create-fold M-2=file M-3=pick    | copy  _ top _ move |     0        .    ~n"
  390. insert-string "M-5=put M-6=clear M-7=fold-details   | LEFT  |-----| RIGHT| MAKE-FOLD REM-FOLD~n"
  391. insert-string "M-8=list-buff M-9=line-no M-0=toggle |start-l|_____| end-l| auto-fold del-line~n"
  392. insert-string "                                     | OPEN  | DOWN| CLOSE|~n"
  393. insert-string "   Folding Microemacs                | pick  - end - put  |~n"
  394. insert-string "   PCSP - Southampton University     ----------------------~n"
  395. !force add-mode "view"
  396. !force $curline resize-window
  397. unmark-buffer
  398. delete-window
  399. set %rcfkeys FALSE
  400. set %moving FALSE
  401. set $sscroll TRUE
  402. ;execute-macro-1
  403. ;}}}
  404.  
  405. !force add-mode exact
  406. !force add-mode magic
  407.  
  408. !force add-global-mode exact
  409. !force add-global-mode magic
  410.  
  411. 2 handle-tab
  412.  
  413. set $discmd TRUE        
  414.  
  415. write-message "[Setup done]"
  416.  
  417.  
  418.